package com.chenyi.file.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 读取七牛云上传相关配置
 *
 * @author wangkh
 */
@Component
@ConfigurationProperties(prefix = "file.qiniu")
@PropertySource(value = { "classpath:plugin-file.yml" } , encoding="UTF-8")
public class FileQiniuConfig {


    private static String region;

    private static String accessKey;

    private static String secretKey;

    private static String bucket;

    private static String host;

    public static String getRegion() {
        return region;
    }

    @Value("${region}")
    public void setRegion(String region) {
        FileQiniuConfig.region = region;
    }

    public static String getAccessKey() {
        return accessKey;
    }

    @Value("${accessKey}")
    public  void setAccessKey(String accessKey) {
        FileQiniuConfig.accessKey = accessKey;
    }

    public static String getSecretKey() {
        return secretKey;
    }

    @Value("${secretKey}")
    public  void setSecretKey(String secretKey) {
        FileQiniuConfig.secretKey = secretKey;
    }

    public static String getBucket() {
        return bucket;
    }

    @Value("${bucket}")
    public void setBucket(String bucket) {
        FileQiniuConfig.bucket = bucket;
    }

    public static String getHost() {
        return host;
    }

    @Value("${host}")
    public  void setHost(String host) {
        FileQiniuConfig.host = host;
    }
}
